#include "StatusAttributes.h"

StatusAttributes::StatusAttributes() 
	: mHealth(100),
	mDamage(15),
	str(1),
	agi(1),
	vit(1),
	speed(.5f),
	attackSpeed(1),
	mLevel(1),
	mStatPoints(0)
{

}

void StatusAttributes::LevelUp()
{
	++mLevel;
	ComputeStatPoints();
}

void StatusAttributes::SetLevel( int level )
{
	mLevel = level;
	ComputeStatPoints();
}

void StatusAttributes::TakeDamage( int damage )
{
	mHealth -= damage;
	if(mHealth < 0)
		mHealth = 0;
}

void StatusAttributes::ComputeStatPoints()
{
	mStatPoints = mLevel * 2;
	mStatPoints -= str - agi - vit;
}
